@extends('default.layouts.adminPublic')
@section('title', '岗位模板管理')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/admin/indexList.css')}}">
    @endsection
    @section('content')
            <!--导航开始-->
    <div class="crumb_warp">
        <i class="fa fa-home"></i> <a href="{{url('admin/job_template')}}">首页</a> &raquo; 岗位模板管理
    </div>
    <!--导航结束-->
    <!--结果集标题与导航组件 开始-->

    <div class="con">
        <div class="conMain">
            <div class="result_wrap">
                <div class="search">
                    <form name="Formso" id="Formso" action="{{url('admin/job_template/job_list')}}" method="post">
                        {{csrf_field()}}
                        <span>关键字：</span>
                        <span><input name="keyword" class="keyword" id="keyword" placeholder="请输入岗位模板名称"
                                     type="text"></span>
                        <span><input name="submit" class="skeyword" value="搜索" type="submit"></span>
                    </form>
                </div>
                <div class="message" style="margin-top: 15px;">
                    <p><span style="margin-right: 20px; font-size: 15px;"><a
                                    href="{{url('admin/job_template/create')}}"><i
                                        class="fa fa-plus"></i>添加岗位模板</a></span>
                            <span>目前共查找到<strong>{{$companyJobTemplate->total()}}</strong>个岗位模板！且每页显示岗位模板记录{{$companyJobTemplate->perPage()}}个.</span>
                    </p>
                </div>
            </div>
            <div class="manage">
                @include('flash::message')
            </div>
            <div class="conInfo">
                <form name="thisForm" id="thisForm" action="" method="post">
                    {{csrf_field()}}
                    <div class="conList" id="conList">
                        <dl class="one">
                            <dt><input name="selectall" type="checkbox" value="1" onclick="CheckAll(this)"/></dt>
                            <dd class="jobtemplate1">岗位名称</dd>
                            <dd class="jobtemplate2">所选类别</dd>
                            <dd class="jobtemplate3">模板描述</dd>
                            <dd class="jobtemplate7">模板操作</dd>
                        </dl>
                        @if(count($companyJobTemplate) > 0 )
                            @foreach($companyJobTemplate as $v)
                                <dl id="list{{$v->id}}">
                                    <dt><input name="selected_id[]" type="checkbox" value="{{$v->id}}"/></dt>
                                    <dd class="jobtemplate1">
                                        <span style="color:#337ab7">{{str_limit($v->job_name,16)}}</span>
                                    </dd>
                                    <dd class="jobtemplate2">
                                        <span>{{str_limit($v->jobsort,32)}}</span>
                                    </dd>
                                    <dd class="jobtemplate3">{{str_limit($v->description,36)}}</dd>
                                    <dd class="jobtemplate7">
                                        <span><a href="{{url('admin/job_template/'.$v->id.'/edit')}}">修改岗位模板</a></span>
                                        <span><a onclick="delAd({{$v->id}})">删除岗位模板</a></span>
                                    </dd>
                                </dl>
                            @endforeach
                        @else
                            <div class="nullcon">对不起！没有岗位模板条件的记录！</div>
                        @endif
                        <dl class="last">
                            <dt>
                                <input name="selectall" id="selectall" type="checkbox" value="1"
                                       onclick="CheckAll(this)"/>
                                <label for="selectall">全选</label>
                            </dt>
                        </dl>
                    </div>
                </form>
                <div class="page_list" style="width: 100%; float: left; margin-top:15px;">
                    {!! $companyJobTemplate->links() !!}
                </div>
            </div>

            <div class="stopper" style="margin-top:10px; border-top: 1px solid #e5e5e5"></div>
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->
@endsection

@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/admin/advertising.js')}}"></script>
    <script>
        //删除岗位模板
        function delAd(id){
            layer.confirm('您确定要删除这份岗位模板吗？', {
                btn: ['确定', '取消'] //按钮
            }, function(){
                $.post("{{url('admin/job_template/')}}/" + id, {
                    '_method': 'delete',
                    '_token': "{{csrf_token()}}"
                }, function(data){
                    if(data.status == 0){
                        layer.msg(data.msg, {icon: 6, time: 1500});
                        location = '{{url('admin/job_template')}}';
                    }else{
                        layer.msg(data.msg, {icon: 5, time: 1500});
                    }
                });
            });
        }
    </script>
@endsection